import request from '@/utils/request'

export function login(data) {
    return request({
        url: 'admin/login',
        method: 'post',
        data: data
    })
}

export function getInfo() {
    return request({
        url: 'admin/info',
        method: 'get'
    })
}
//首页banner
export function getBanner() {
    return request({
        url: 'api/banner/list',
        method: 'get'
    })
}

// 大洲带国家（热门）
export function getcountry() {
    return request({
        url: '/api/country/all',
        method: 'get'
    })
}
// 全部国家
export function getcountryAll() {
    return request({
        url: '/api/country/page',
        method: 'get'
    })
}

// 全部项目
export function getProjectList(data) {
    return request({
        url: 'api/project/page',
        method: 'get',
        params: data
    })
}
//
export function getProjectHotId(id) {
    return request({
        url: '/api/project/hot/'+id,
        method: 'get'
    })
}
// 热门项目
export function getProjectHot() {
    return request({
        url: 'api/project/hot',
        method: 'get'
    })
}
// 项目详情
export function getProjectDetail(id) {
    return request({
        url: 'api/project/'+id,
        method: 'get',
    })
}

//新闻资讯
export function getNews(data) {
    return request({
        url: 'api/news/page',
        method: 'get',
        params: data
    })
}
//新闻资讯详情
export function getNewsDetail(id) {
    return request({
        url: 'api/news/'+id, // ${id}
        method: 'get',
    })
}
//免费评估
export function apply(data) {
    return request({
        url: '/api/customize/apply',
        method: 'post',
        data: data
    })
}

// 全部房产
export function getHouseAll(data) {
    return request({
        url: '/api/house/page',
        method: 'get',
        params: data
    })
}
//热门房产
export function gethouse() {
    return request({
        url: '/api/house/hot',
        method: 'get'
    })
}
//房产详情
export function gethouseDetail(id) {
    return request({
        url: 'api/house/'+id, // ${id}
        method: 'get',
    })
}

// 提交信息
export function setApplyData(data) {
    return request({
        url: '/admin/apply/page',
        method: 'get',
        params: data
    })
}

export default { login, getInfo, getBanner, getcountry, getcountryAll, getProjectList, getProjectHotId, getProjectHot, getProjectDetail, getNews, getNewsDetail, apply, getHouseAll, gethouse, gethouseDetail, setApplyData }